<?php
// +----------------------------------------------------------------------
// | 07FLYCRM [基于ThinkPHP5.0开发]
// +----------------------------------------------------------------------
// | Copyright (c) 2016-2021 http://www.07fly.xyz
// +----------------------------------------------------------------------
// | Professional because of focus  Persevering because of happiness
// +----------------------------------------------------------------------
// | Author: 开发人生 <goodkfrs@qq.com>
// +----------------------------------------------------------------------
namespace app\workflow\model;

/**
 * 报销单管理=》模型
 */
class OaReimburse extends WorkflowBase
{
	/**费用类型，已审核的不能删除
	 * @param string $sType
	 * @return array|mixed
	 * Author: lingqifei created by at 2020/4/15 0015
	 */
	public  function type($key = '')
	{
		$data = array(
			"1" => array(
				'name' => '招待费',
				'html' => '<span class="label label-warning">招待费<span>',
				'action' => array(
				),
			),
			"2" => array(
				'name' => '交通费',
				'html' => '<span class="label label-info">交通费<span>',
				'action' => array(

				),
			),
			"3" => array(
				'name' => '酒店费',
				'html' => '<span class="label label-info">酒店费<span>',
				'action' => array(
				),
			),
			"4" => array(
				'name' => '通讯费',
				'html' => '<span class="label label-info">通讯费<span>',
				'action' => array(
				),
			),
			"5" => array(
				'name' => '物流费',
				'html' => '<span class="label label-info">物流费<span>',
				'action' => array(
				),
			),
			"6" => array(
				'name' => '礼品费',
				'html' => '<span class="label label-info">礼品费<span>',
				'action' => array(
				),
			),
			"7" => array(
				'name' => '其他',
				'html' => '<span class="label label-info">其他<span>',
				'action' => array(
				),
			),
		);
		return (array_key_exists($key,$data))?$data[$key]:$data;
	}

	/**
	 * 申请=》状态
	 * 0=临时单，1=待审核，2=已通过，3=被否决，4=被驳回，5=已撤销
	 * @param string $key
	 * @return array|mixed
	 * Author: kfrs <goodkfrs@QQ.com> created by at 2020/10/28 0028
	 */
	public function status($key = '')
	{
		$data = array(
			"0" => array(
				'name' => '待提交',
				'html' => '<span class="label">待提交<span>',
				'action' => array(
					array(
						'url' => url('audit_send',array('status'=>'1')),
						'class' => 'ajax-open',
						'color' => '#23B7E5',
						'name' => '提交审批'
					),
					array(
						'url' => url('edit'),
						'class' => 'ajax-open',
						'color' => '#1c84c6',
						'name' => '修改'
					),
					array(
						'url' => url('del'),
						'class' => 'ajax-del',
						'color' => '#1c84c6',
						'name' => '删除'
					),array(
						'url' => url('detail'),
						'class' => 'ajax-open',
						'color' => '#23B7E5',
						'name' => '详细'
					),
				),
			),
			"1" => array(
				'name' => '待审核',
				'html' => '<span class="label label-info">待审核<span>',
				'action' => array(
					array(
						'url' => url('audit_cancel',array('status'=>'5')),
						'class' => 'ajax-get confirm',
						'color' => '#23B7E5',
						'name' => '撤销审核'
					),
					array(
						'url' => url('audit_detail'),
						'class' => 'ajax-open',
						'color' => '#23B7E5',
						'name' => '查看审批'
					)
				),
			),
			"2" => array(
				'name' => '已通过',
				'html' => '<span class="label label-success">已通过<span>',
				'action' => array(
					array(
						'url' => url('detail'),
						'class' => 'ajax-open',
						'color' => '#23B7E5',
						'name' => '详细'
					)
				),
			),
			"3" => array(
				'name' => '被否决',
				'html' => '<span class="label label-danger">被否决<span>',
				'action' => array(
					array(
						'url' => url('audit_send',array('status'=>'1')),
						'class' => 'ajax-open',
						'color' => '#23B7E5',
						'name' => '提交审核'
					),
					array(
						'url' => url('detail'),
						'class' => 'ajax-open',
						'color' => '#23B7E5',
						'name' => '详细'
					),
					array(
						'url' => url('edit'),
						'class' => 'ajax-open',
						'color' => '#23B7E5',
						'name' => '修改'
					),
					array(
						'url' => url('del'),
						'class' => 'ajax-del',
						'color' => '#23B7E5',
						'name' => '删除'
					),
				),
			),
			"4" => array(
				'name' => '被驳回',
				'html' => '<span class="label label-warning">被驳回<span>',
				'action' => array(
					array(
						'url' => url('audit_send',array('status'=>'1')),
						'class' => 'ajax-open',
						'color' => '#23B7E5',
						'name' => '提交审核'
					),

					array(
						'url' => url('edit'),
						'class' => 'ajax-open',
						'color' => '#23B7E5',
						'name' => '修改'
					),
					array(
						'url' => url('del'),
						'class' => 'ajax-del',
						'color' => '#23B7E5',
						'name' => '删除'
					),
				),
			),
			"5" => array(
				'name' => '被撤消',
				'html' => '<span class="label label-default">被撤消<span>',
				'action' => array(
					array(
						'url' => url('audit_send',array('status'=>'1')),
						'class' => 'ajax-open',
						'color' => '#23B7E5',
						'name' => '提交审核'
					),
					array(
						'url' => url('detail'),
						'class' => 'ajax-open',
						'color' => '#23B7E5',
						'name' => '详细'
					),
					array(
						'url' => url('edit'),
						'class' => 'ajax-open',
						'color' => '#23B7E5',
						'name' => '修改'
					),
					array(
						'url' => url('del'),
						'class' => 'ajax-del',
						'color' => '#23B7E5',
						'name' => '删除'
					),
				),
			),
		);
		return (array_key_exists($key, $data)) ? $data[$key] : $data;
	}

}
